package ebj.common.redis.helper;

import org.apache.log4j.Logger;
/**
 * 
 * @author Martin Zhou
 *
 */
public class CommonLogger {
	Logger logger = null;

	public <T> CommonLogger(Class<T> typeOfT) {
		super();
		logger = Logger.getLogger(typeOfT);
	}


	/* Debug < Info < Warn < Error < Fatal */
	public void debug(String message) {
		System.out.println(message);
		logger.debug(message);
	}

	public void info(String message) {
		System.out.println(message);
		logger.info(message);
	}

	public void warn(String message) {
		System.out.println(message);
		logger.warn(message);
	}

	public void error(String message, Exception e) {
		System.out.println(message + " || " + e.getMessage());
		logger.error(message, e);
	}

	public void fatal(String message, Exception e) {
		System.out.println(message + " || " + e.getMessage());
		logger.fatal(message, e);
	}
}
